package demo.hw;

/**
 * 输入
 * 1516000
 * 输出
 * 0006151
 *
 * @author taqo
 * @date 2021/5/25
 */
public class _数字颠倒 {
    public static void main(String[] args) {
        int a = 1516000;
        reverse(a);
    }

    private static void reverse(int a) {
        StringBuilder sb = new StringBuilder();
        int tmp = 0;
        while (a !=0 ) {
            int c = a % 10;
            sb.append(c);
            tmp = tmp*10 + c;
            a /= 10;
        }
        System.out.println(sb.toString());
    }
}
